// var expect = require('chai').expect;
var HomePage = require('../pageobjects/home.page');
var TradePage = require('../pageobjects/trade.page');
var assert = require('assert')

describe('交易_买入_港股', function () {
	this.timeout(10000)
	
	it('launch the app',function() {
		return HomePage.run()
	})
	
    it('Login', function () {
        return HomePage.login('customerID','customerPassWrod')
        .waitUntilTextExists(TradePage.account,'customerID').getText(TradePage.account)
        .then
        (function (count) {
            // console.log(count)
            assert.equal(count, 'customerID')
        })
    })

    it('买入港股', function () {
        return HomePage.app.client.waitUntilWindowLoaded()
        .waitForExist(TradePage.ipo)
        
        .waitUntilTextExists(TradePage.info,'提示').getText(TradePage.info_content)
        .then
        (function (information) {
            // console.log(count)
            assert.equal(information, '已经存在该客户的新股申购信息')
        })
    })

    it('quit the app',function () {
        return HomePage.quit()
    })
});